/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.garethc.designpatterns.structural.bridge;

/**
 *
 * @author Gareth
 */
public abstract class Vehicle {
    Engine engine;
    int weightInKilos;
    int ratio;
    
    public abstract void drive();
    
    public void setEngine(Engine engine) {
        this.engine = engine;
    }
    
    public void reportOnSpeed(int horsepower)
    {
        ratio = weightInKilos / horsepower;
        
        if (ratio < 3)
        {
            System.out.println("Vehicle is going at a fast speed");
        }
        
        else if ((ratio >= 3) && (ratio < 8))
        {
            System.out.println("Vehicle is going at an average speed");
        }
        
        else
        {
            System.out.println("Vehicle is going at a slow speed");
        }
                
    }
    
    public int getRatio()
    {
        return ratio;
    }
}
